<template>
	<view>
		<block name="menu">
			<view class="menu_content" v-if="showmenu == 10">
				<view class="menu_content_list">
					<view class="menu_content_dis">
						<view class="menu_content_cont" @tap="jump_indexs">
							<view class="menu_content_img"><image :src="imgUrl + (current == 0 ? 'dzx_imgs11.png' : 'dzx_imgs1.png')"></image></view>
							<view :style="'color:' + (current == 0 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.home') }}</view>
						</view>
						<view class="menu_content_cont" @tap="jump_chaxun">
							<view class="menu_content_img"><image :src="imgUrl + (current == 1 ? 'dzx_imgs22.png' : 'dzx_imgs2.png')"></image></view>
							<view :style="'color:' + (current == 1 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.query') }}</view>
						</view>
					</view>

					<view class="menu_content_cont2" @tap="tankuang">
						<view class="menu_content_img2"><image :src="imgUrl + (current == 2 ? 'dzx_imgs5.png' : 'dzx_imgs5.png')"></image></view>
					</view>

					<view class="menu_content_dis2">
						<view class="menu_content_cont" @tap="jump_pintuan">
							<view class="menu_content_img"><image :src="imgUrl + (current == 5 ? 'dzx_imgs33.png' : 'dzx_imgs3.png')"></image></view>
							<view :style="'color:' + (current == 5 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.grouping') }}</view>
						</view>
						<view class="menu_content_cont" @tap="jump_personal">
							<view class="menu_content_img"><image :src="imgUrl + (current == 4 ? 'dzx_imgs44.png' : 'dzx_imgs4.png')"></image></view>
							<view :style="'color:' + (current == 4 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.mine') }}</view>
						</view>
					</view>
				</view>
			</view>
			<view class="menu_content" v-if="showmenu == 20">
				<view class="menu_content_list">
					<view class="menu_content_dis">
						<view class="menu_content_cont" @tap="jump_indexs">
							<view class="menu_content_img"><image :src="imgUrl + (current == 0 ? 'dzx_imgs11.png' : 'dzx_imgs1.png')"></image></view>
							<view :style="'color:' + (current == 0 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.home') }}</view>
						</view>
						<view class="menu_content_cont" @tap="jump_chaxun">
							<view class="menu_content_img"><image :src="imgUrl + (current == 1 ? 'dzx_imgs22.png' : 'dzx_imgs2.png')"></image></view>
							<view :style="'color:' + (current == 1 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.query') }}</view>
						</view>
					</view>

					<view class="menu_content_cont2" @tap="tankuang">
						<view class="menu_content_img2"><image :src="imgUrl + (current == 2 ? 'dzx_imgs5.png' : 'dzx_imgs5.png')"></image></view>
					</view>

					<view class="menu_content_dis2">
						<view class="menu_content_cont" @tap="jump_yunfei">
							<view class="menu_content_img"><image :src="imgUrl + (current == 3 ? 'dzx_imgs33.png' : 'dzx_imgs3.png')"></image></view>
							<view :style="'color:' + (current == 3 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.freight') }}</view>
						</view>
						<view class="menu_content_cont" @tap="jump_personal">
							<view class="menu_content_img"><image :src="imgUrl + (current == 4 ? 'dzx_imgs44.png' : 'dzx_imgs4.png')"></image></view>
							<view :style="'color:' + (current == 4 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.mine') }}</view>
						</view>
					</view>
				</view>
			</view>
			<view class="menu_content" v-if="showmenu == 30">
				<view class="menu_content_list">
					<view class="menu_content_dis" style="width: 100%">
						<view class="menu_content_cont" @tap="jump_indexs">
							<view class="menu_content_img"><image :src="imgUrl + (current == 0 ? 'dzx_imgs11.png' : 'dzx_imgs1.png')"></image></view>
							<view :style="'color:' + (current == 0 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.home') }}</view>
						</view>
						<view class="menu_content_cont" @tap="jump_chaxun">
							<view class="menu_content_img"><image :src="imgUrl + (current == 1 ? 'dzx_imgs22.png' : 'dzx_imgs2.png')"></image></view>
							<view :style="'color:' + (current == 1 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.search') }}</view>
						</view>
						<view class="menu_content_cont" @tap="jump_yunfei">
							<view class="menu_content_img"><image :src="imgUrl + (current == 3 ? 'dzx_imgs33.png' : 'dzx_imgs3.png')"></image></view>
							<view :style="'color:' + (current == 3 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.freight') }}</view>
						</view>
						<view class="menu_content_cont" @tap="jump_personal">
							<view class="menu_content_img"><image :src="imgUrl + (current == 4 ? 'dzx_imgs44.png' : 'dzx_imgs4.png')"></image></view>
							<view :style="'color:' + (current == 4 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.mine') }}</view>
						</view>
					</view>
				</view>
			</view>
			<view class="menu_content" v-if="showmenu == 40">
				<view class="menu_content_list">
					<view class="menu_content_dis" style="width: 100%">
						<view class="menu_content_cont" @tap="jump_indexs">
							<view class="menu_content_img"><image :src="imgUrl + (current == 0 ? 'dzx_imgs11.png' : 'dzx_imgs1.png')"></image></view>
							<view :style="'color:' + (current == 0 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.home') }}</view>
						</view>
						<view class="menu_content_cont" @tap="jump_chaxun">
							<view class="menu_content_img"><image :src="imgUrl + (current == 1 ? 'dzx_imgs22.png' : 'dzx_imgs2.png')"></image></view>
							<view :style="'color:' + (current == 1 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.search') }}</view>
						</view>
						<view class="menu_content_cont" @tap="jump_yunfei">
							<view class="menu_content_img"><image :src="imgUrl + (current == 3 ? 'dzx_imgs55.png' : 'dzx_imgs6.png')"></image></view>
							<view :style="'color:' + (current == 3 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.freight') }}</view>
						</view>
						<view class="menu_content_cont" @tap="jump_pintuan">
							<view class="menu_content_img"><image :src="imgUrl + (current == 5 ? 'dzx_imgs33.png' : 'dzx_imgs3.png')"></image></view>
							<view :style="'color:' + (current == 5 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.grouping') }}</view>
						</view>
						<view class="menu_content_cont" @tap="jump_personal">
							<view class="menu_content_img"><image :src="imgUrl + (current == 4 ? 'dzx_imgs44.png' : 'dzx_imgs4.png')"></image></view>
							<view :style="'color:' + (current == 4 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.mine') }}</view>
						</view>
					</view>
				</view>
			</view>
			<view class="menu_content" v-if="showmenu == 50">
				<view class="menu_content_list">
					<view class="menu_content_dis" style="width: 100%">
						<view class="menu_content_cont" @tap="jump_indexs">
							<view class="menu_content_img"><image :src="imgUrl + (current == 0 ? 'dzx_imgs11.png' : 'dzx_imgs1.png')"></image></view>
							<view :style="'color:' + (current == 0 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.home') }}</view>
						</view>
						<view class="menu_content_cont" @tap="jump_chaxun">
							<view class="menu_content_img"><image :src="imgUrl + (current == 1 ? 'dzx_imgs22.png' : 'dzx_imgs2.png')"></image></view>
							<view :style="'color:' + (current == 1 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.search') }}</view>
						</view>
						<view class="menu_content_cont" @tap="jump_yunfei">
							<view class="menu_content_img"><image :src="imgUrl + (current == 3 ? 'dzx_imgs33.png' : 'dzx_imgs3.png')"></image></view>
							<view :style="'color:' + (current == 3 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.freight') }}</view>
						</view>
						<view class="menu_content_cont" @tap="jump_shop">
							<view class="menu_content_img"><image :src="imgUrl + (current == 5 ? 'shopping-fill_select.png' : 'shopping-fill.png')"></image></view>
							<view :style="'color:' + (current == 5 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.shop') }}</view>
						</view>
						<view class="menu_content_cont" @tap="jump_personal">
							<view class="menu_content_img"><image :src="imgUrl + (current == 4 ? 'dzx_imgs44.png' : 'dzx_imgs4.png')"></image></view>
							<view :style="'color:' + (current == 4 ? '#393939' : '#666')" class="menu_content_txt">{{ $t('tabbar.mine') }}</view>
						</view>
					</view>
				</view>
			</view>
			<!---fffff-->
			<view class="index_tankuangs" v-if="tankuangisshows">
				<view class="index_tankuangs_tan">
					<view class="index_tankuangs_list">
						<view class="index_tankuangs_cont" @tap="tiaozhuan" data-url="/pages/indexs/baoguoyg/baoguoyg">
							<image :src="imgUrl + '/dzx_img60.png'"></image>
							<view class="index_tankuangs_cont_txt">
								<view class="index_tankuangs_cont_t1">{{ $t('tabbar.packageForecast') }}</view>
								<view class="index_tankuangs_cont_t2">{{ $t('tabbar.forecast_the_package_in_advance') }}</view>
							</view>
						</view>
						<view class="index_tankuangs_cont" @tap="jump_chaxun">
							<image :src="imgUrl + '/dzx_img61.png'"></image>
							<view class="index_tankuangs_cont_txt">
								<view class="index_tankuangs_cont_t1">{{ $t('tabbar.trajectory_query') }}</view>
								<view class="index_tankuangs_cont_t2">{{ $t('tabbar.check_the_status_of_the_package') }}</view>
							</view>
						</view>
						<view class="index_tankuangs_cont" @tap="tiaozhuan" data-url="/pages/indexs/yunfeigusuan/yunfeigusuan">
							<image :src="imgUrl + '/dzx_img62.png'"></image>
							<view class="index_tankuangs_cont_txt">
								<view class="index_tankuangs_cont_t1">{{ $t('tabbar.shipping_estimate') }}</view>
								<view class="index_tankuangs_cont_t2">{{ $t('tabbar.find_the_best_route') }}</view>
							</view>
						</view>
						<!-- 申请打包 注释 -->
						<!-- <view class="index_tankuangs_cont" @tap="tiaozhuan" data-url="/pages/indexs/shenqingdb/shenqingdb">
							<image :src="imgUrl + '/dzx_img63.png'"></image>
							<view class="index_tankuangs_cont_txt">
								<view class="index_tankuangs_cont_t1">{{ $t('tabbar.apply_for_packaging') }}</view>
								<view class="index_tankuangs_cont_t2">{{ $t('tabbar.submit_package_request') }}</view>
							</view>
						</view> -->
					</view>
					<view class="index_tankuangs_cha" @tap="tankuangguanbi"><image :src="imgUrl + '/dzx_img64.png'"></image></view>
				</view>
			</view>
		</block>
	</view>
</template>

<script>
// index.js
// 获取应用实例
const app = getApp();
export default {
	name: 'tabbar',
	props: {
		current: 0,
		showmenu: 0
	},
	data() {
		return {
			motto: 'Hello World',
			userInfo: {},
			hasUserInfo: false,
			canIUse: uni.canIUse('button.open-type.getUserInfo'),
			canIUseGetUserProfile: false,
			canIUseOpenData: uni.canIUse('open-data.type.userAvatarUrl') && uni.canIUse('open-data.type.userNickName'),
			imgUrl: app.globalData.imgUrl,
			// 如需尝试获取用户信息可改为false
			culturelistId: 0,
			tankuangisshows: false,
			colors: '#fff;',
			isfujin: '',
			isshop: '',
			navH: '',
			statusBarHeight: ''
		};
	},
	onLoad() {
		if (uni.getUserProfile) {
			this.canIUseGetUserProfile= true
		}
		this.menu();
		this.statusBarHeight= app.globalData.statusBar
		this.colors= app.globalData.colors
	},
	onShow() {},
	methods: {
		tankuang() {
			this.tankuangisshows= true
		},
		tankuangguanbi() {
			this.tankuangisshows= false
		},
		tiaozhuan(e) {
			var type = e.currentTarget.dataset.type;
			var urlweb = e.currentTarget.dataset.url;
			if (type == 2) {
				uni.navigateTo({
					url: '/pages/webview/webview?' + 'url=' + urlweb
				});
			}
			uni.navigateTo({
				url: e.currentTarget.dataset.url
			});
		},
		jump_indexs(e) {
			console.log('sssssss');
			uni.reLaunch({
				url: '/pages/index/index'
			});
		},
		jump_chaxun(e) {
			uni.reLaunch({
				url: '/pages/chaxun/chaxun'
			});
		},

		jump_pintuan(e) {
			uni.reLaunch({
				url: '/pages/pintuan/pintuan'
			});
		},

		jump_yunfei(e) {
			uni.navigateTo({
				url: '/pages/indexs/yunfeigusuan/yunfeigusuan'
			});
		},
		
		jump_shop(e) {
			uni.navigateTo({
				url: '/pages/home/index'
			});
		},

		jump_personal(e) {
			uni.reLaunch({
				url: '/pages/my/my'
			});
		},

		culturelistclick(e) {
			this.culturelistId= e.currentTarget.dataset.id
		},

		getUserProfile(e) {
			// 推荐使用wx.getUserProfile获取用户信息，开发者每次通过该接口获取用户个人信息均需用户确认，开发者妥善保管用户快速填写的头像昵称，避免重复弹窗
			uni.getUserProfile({
				desc: '展示用户信息',
				// 声明获取用户个人信息后的用途，后续会展示在弹窗中，请谨慎填写
				success: res => {
					console.log(res);
					this.userInfo= res.userInfo
					this.hasUserInfo= true
				}
			});
		},

		getUserInfo(e) {
			// 不推荐使用getUserInfo获取用户信息，预计自2021年4月13日起，getUserInfo将不再弹出弹窗，并直接返回匿名的用户个人信息
			console.log(e);
			this.userInfo= e.detail.userInfo
			this.hasUserInfo= true
		}
	}
};
</script>
<style>
@import './tabbar.css';
</style>
